{% extends "base.html" %}

{% load static %}

{% block title %}Login{% endblock %}

{% block content %}
    <div class="row text-center vertical-middle-sm">
    <h1>Login--Built in Method of Django</h1>
    {% if form.error %}
        <p>Your username and password didn't match. Please try again.</p>
    {% endif %}

    <p>Input your username and password</p>

    {% if next %}
        <form class="form-horizontal" action="{% url 'account:user_login' %}?next={{ next }}" method="post">
    {% else %}
        <form class="form-horizontal" action="{% url 'account:user_login' %}" method="post">
    {% endif %}
            {% csrf_token %}
            <div class="form-group">
                <label for="{{ form.username.id_for_label }}" class="col-md-5 control-label" style="color:red">
                    <span class="glyphicon glyphicon-user">Username</span>
                </label>
                <div class="col-md-6 text-left">{{ form.username }}</div>
            </div>
            <div class="form-group">
                <label for="{{ form.password.id_for_label }}" class="col-md-5 control-label" style="color:blue;">
                    <span class="glyphicon glyphicon-floppy-open">Password</span>
                </label>
                <div class="col-md-6 text-left">{{ form.password }}</div>
            </div>
            <input type="submit" class="btn btn-primary btn-lg" value="Login">
        </form>
    </div>
{% endblock %}